<script setup>

import {ShoppingCart, UserFilled} from "@element-plus/icons-vue";
</script>

<template>
  <el-row class="banner">
  <!--  logo  -->
    <el-col :span="6">
      <div class="grid-content ep-bg-purple">
        <img src="@/assets/logo.png" width="100px" height="100px" alt="">
      </div>
    </el-col>
<!--  搜素  -->
    <el-col :span="6">
      <div class="grid-content ep-bg-purple-light">
        <el-input size="small" placeholder="搜索关键字" clearable style="width: 250px;"></el-input>
        <el-button size="small" type="primary">
          <el-icon><Search /></el-icon>搜索
        </el-button>
      </div>
    </el-col>
<!--  按钮  -->
    <el-col :span="12">
      <div class="grid-content ep-bg-purple"><!--  后面的按钮 -->
        <el-button-group>
          <el-button type="primary" size="small" >
            <el-icon><UserFilled /></el-icon>欢迎您：
          </el-button>
          <el-button type="primary" size="small" >
            <el-icon><ShoppingCart /></el-icon>购物车
          </el-button>
          <el-button type="primary" size="small" >
            <el-icon><Star /></el-icon>我的收藏
          </el-button>
          <el-button type="primary" size="small" >
            <el-icon><Menu /></el-icon>我的订单
          </el-button>
          <el-button type="primary" size="small" >
            <el-icon><CloseBold /></el-icon>退出</el-button>
          <el-button type="primary" size="small" >
            <el-icon><Fold /></el-icon>登录
          </el-button>
          <el-button type="primary" size="small" >
            <el-icon><Edit /></el-icon>注册
          </el-button>
        </el-button-group>
      </div>
    </el-col>
  </el-row>
</template>

<style scoped>
/* 基础样式优化 */
.banner {
  height: 100px;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 0 20px;
}

/* Logo 区域优化 - 修改部分 */
.grid-content.ep-bg-purple {
  display: flex;
  justify-content: center; /* 新增：水平居中 */
  align-items: center;
  height: 100%;
  padding-right: 20px; /* 新增：与搜索区域保持间距 */
}
.grid-content.ep-bg-purple img {
  transition: transform 0.3s ease;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 0 auto; /* 新增：确保居中 */
}
.grid-content.ep-bg-purple img:hover {
  transform: scale(1.05);
}

/* 搜索区域优化 - 添加左边距 */
/* 搜索区域优化 - 增大尺寸并完善样式 */
.grid-content.ep-bg-purple-light {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding-left: 20px;
}

.grid-content.ep-bg-purple-light .el-input {
  border-radius: 20px;
  overflow: hidden;
  width: 280px !important;
}
.grid-content.ep-bg-purple-light .el-input :deep(.el-input__inner) {
  height: 36px;
  line-height: 36px;
  padding-left: 15px;
}
.grid-content.ep-bg-purple-light .el-input :deep(.el-input__wrapper) {
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1px 15px;
  height: 38px;
}

.grid-content.ep-bg-purple-light .el-button {
  border-radius: 20px;
  font-weight: 500;
  padding: 10px 15px 10px 10px; /* 增大按钮尺寸，左侧留更多空间给图标 */
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.grid-content.ep-bg-purple-light .el-button i {
  margin-right: 6px; /* 图标和文字间距 */
  font-size: 12px;
}

/* 按钮区域优化 - 增大尺寸并完善图标 */
.el-button-group {
  display: flex;
  gap: 10px; /* 增大按钮间距 */
  flex-wrap: wrap; /* 如果按钮过多可以换行 */
}

.el-button-group .el-button {
  border-radius: 20px;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 10px 12px 10px 10px; /* 增大按钮尺寸，左侧留更多空间给图标 */
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.el-button-group .el-button i {
  margin-right: 6px; /* 图标和文字间距 */
  font-size: 16px;
}
.el-button-group .el-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.el-button-group .el-button--plain {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
}
</style>